package com.kai.demo;

import com.alibaba.fastjson.JSONObject;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;

@SpringBootApplication
@MapperScan("com.kai.demo.mapper")
@EnableGlobalMethodSecurity(securedEnabled = true, prePostEnabled = true)
public class RedisApplication {

    public static void main(String[] args) {
        SpringApplication.run(RedisApplication.class, args);
    }

    /**
     * <p>Project: sprigncloud-demo </p>
     * <p>Description: </p>
     * <p>Copyright (c) 2024 Karrytech (Shanghai/Beijing) Co., Ltd.</p>
     * <p>All Rights Reserved.</p>
     *
     * @author <a href="mailto:zhangkai@karrytech.com">Zhang Kai</a>
     */
    public static class JsonUtil {

        public static String toJson(Object o) {
            return JSONObject.toJSONString(o);
        }

        public static Object pares(String s) {
            return JSONObject.parse(s);
        }
    }
}
